package com.devilvan.map;

import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;

import java.io.IOException;

public class KeyValueTextMapper extends Mapper<Text, Text,Text, LongWritable> {
    LongWritable longWritable = new LongWritable(1);

    @Override
    protected void map(Text key, Text value, Context context) throws IOException, InterruptedException {
        // key出现一次，则输出(text,1)
        context.write(key,longWritable);
    }
}
